package com.example.springtest.Dao;

import cn.hutool.core.io.IoUtil;
import org.springframework.stereotype.Component;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.ArrayList;

@Component
public class DaoImp implements Dao {
    @Override
    public ArrayList<String> findAll() throws FileNotFoundException {
        FileInputStream file=new FileInputStream("SpringTest/src/main/resources/static/user.txt");
        ArrayList<String> list = IoUtil.readUtf8Lines(file, new ArrayList<>());
        return list;
    }
}
